package com.patelski.magic.service;

import java.util.Arrays;
import java.util.List;

import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import org.jboss.seam.log.Log;

import com.patelski.magic.model.EditionCategorie;

@Name("editionCategorieList")
public class EditionCategorieList extends EntityQuery {

	/**
     * 
     */
    private static final long serialVersionUID = -4612085210284074608L;

	private static final String[] RESTRICTIONS = { "lower(edition.name) like concat('%',lower(#{editionList.edition.name}),'%')", };

	private EditionCategorie editionCategorie = new EditionCategorie();

	@Logger
	protected Log log;

	@Override
	public String getEjbql() {
		return "select editionCategorie from EditionCategorie editionCategorie";
	}

	@Override
	public Integer getMaxResults() {
		return 100;
	}

	public EditionCategorie getEditionCategorie() {
		return editionCategorie;
	}

	@Override
	public List<String> getRestrictions() {
		return Arrays.asList(RESTRICTIONS);
	}

	@Override
	public String getOrder() {
		return "editionCategorie.name desc";
	}
}
